$('element').attr('id', 'value');
var $newdiv1 = $( "<div id='object1'></div>" ),
newdiv2 = document.createElement( "div" ),
existingdiv1 = document.getElementById( "foo" );
$( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
$( "li" ).add( "<p id='new'>new paragraph</p>" )
.css( "background-color", "red" );
var pdiv = $( "p" );
pdiv.add( "div" ); // WRONG, pdiv will not change
$( "li" ).add( document.getElementsByTagName( "p" )[ 0 ] )
.css( "background-color", "red" );
$( "li" ).add( "p" ).css( "background-color", "red" );